var should = require('chai').should();
var webdriver = require('selenium-webdriver');
var By = webdriver.By;

var builder = new webdriver.Builder().usingServer("http://127.0.0.1:4444/wd/hub");
 builder.withCapabilities({ browserName : "chrome" });
 var driver = builder.build();

describe ('搜索功能测试', function () {
  beforeEach(function () {
     driver.get("http://47.95.218.7:3000/main");
     });
      afterEach(function () {
        driver.close();
        driver.quit();
      });
     it('测试搜索', function (done) {
           driver.findElement(By.name("search")).click();
           driver.findElement(By.name("search")).clear();
           driver.findElement(By.name("search")).sendKeys("实验");
           driver.findElement(By.xpath("//div[@id='headsearch']/div/button")).click();
           driver.findElement(By.xpath("//body")).click();
            done();
     });
 });
